CREATE TABLE [dbo].[department](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
PRIMARY KEY CLUSTERED ( ID ASC ) )
GO

CREATE TABLE [dbo].[employee](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[Addr] [varchar](100) NULL,
	[Ext] [varchar](20) NULL,
	[DeptID] [int] NULL,
PRIMARY KEY CLUSTERED (	[ID] ASC ) )
GO

ALTER TABLE [dbo].[employee]  WITH CHECK ADD  CONSTRAINT [fk_dept_employee] FOREIGN KEY([DeptID])
REFERENCES [dbo].[department] ([ID])
GO

ALTER TABLE [dbo].[employee] CHECK CONSTRAINT [fk_dept_employee]
GO


